Skip to content

perf: minify page scripts with esbuild at build time - #25

Merged
halitsever merged 1 commit into
mainfrom
perf/minify-js
Dec 1, 2026
Merged

halitsever merged 1 commit into
mainfrom
perf/minify-js

Conversation

@halitsever

Copy link
Copy Markdown
Owner

Semrush Site Audit (tools.halit.org, 2026-12-01) flags 21 unminified JavaScript files: the build copied src/*.js to _site/ as is.

  • scripts/build.mjs runs each page script through esbuild transform (minify, ESM kept, so module imports and file names stay the same).
  • esbuild 0.28.2 is a pinned dev dependency; the workflow runs npm ci before the tests. Nothing new ships to the browser and the CSP is unchanged.
  • Script size in _site/ drops from about 165 KB to 91 KB.

Checks:

  • npm test: 183 pass.
  • Headless Chrome smoke test over all 25 built pages: no page errors, and each tool's output for the same input is identical to the current main build.
  • npm run check times out on this machine at the 5-million-character repeater step on main as well (memory pressure), so it was not a usable signal here.

@halitsever
halitsever merged commit 2b1e308 into main Dec 1, 2026
2 checks passed
@halitsever
halitsever deleted the perf/minify-js branch December 1, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant